package com.apes.autoparts.product.model;

/**
 * 类描述：油液类标准商品
 *
 * @ClassName oilyProduct
 * @Description 描述
 * @Author wushilong
 * @Date 2022/10/26 15:22
 * @Version 1.0
 */

import com.apes.framework.jpa.BaseModel;
import com.apes.framework.jpa.DefaultPersistListener;
import com.apes.framework.jpa.comment.Comment;
import com.apes.framework.jpa.generator.ApesGenerator;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.SelectBeforeUpdate;

import javax.persistence.*;


@Getter
@Setter
@SelectBeforeUpdate
@DynamicInsert
@DynamicUpdate
@Entity
@EntityListeners(DefaultPersistListener.class)
@Table(name = OilyProduct.CONST_TABLE_NAME)
public class OilyProduct extends BaseModel {
    public static final String CONST_TABLE_NAME = "auto_oily_product";

    @Id
    @Column(name = "id", length = 10)
    @ApesGenerator(code = CONST_TABLE_NAME, name = "油液类标准商品")
    @Comment("编码")
    private String id;

    @Column(name = "brand", length = 100)
    @Comment("品牌")
    private String brand;

    @Column(name = "name", length = 100)
    @Comment("零件名称")
    private String name;//零件名称

    @Column(name = "unit", length = 10)
    @Comment("单位")
    private String unit;

    @Column(name = "catena", length = 100)
    @Comment("系列")
    private String catena;

    @Column(name = "model_number", length = 100)
    @Comment("型号")
    private String modelNumber;

    @Column(name = "capacity", length = 24)
    @Comment("容量[L]")
    private Double capacity;//单位：L（升）

    @Column(name = "api_class", length = 100)
    @Comment("API等级")
    private String apiClass;

    @Column(name = "viscosity_class", length = 100)
    @Comment("粘度等级")
    private String viscosityClass;

    @Column(name = "type", length = 100)
    @Comment("类型")
    private String type;

    @Column(name = "engine_oil_type", length = 100)
    @Comment("机油类型")
    private String engineOilType;

    @Column(name = "description", length = 100)
    @Comment("产品描述")
    private String description;

    @Column(name = "bar_code", length = 100)
    @Comment("条形码")
    private String barCode;

    @Column(name = "ERP_product_id", length = 100)
    @Comment("ERP商品编码")
    private String ERPProductId;
}
